/**
 * 
 */
package com.taobao.wolfwolf.hibernate.service.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.ProviderDao;
import com.taobao.wolfwolf.hibernate.pojo.Provider;
import com.taobao.wolfwolf.hibernate.service.ProviderService;

/**
 * @author Tux
 *
 * 创建时间: 2011-5-9 下午03:31:12
 */
public class ProviderServiceImpl extends BaseServiceImpl implements ProviderService {
	private ProviderDao pdao;

	public List<Provider> findAll() {
		try {
			return pdao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Provider findById(int id) {
		try {
			return pdao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}

	public List<Provider> findByName(String name) {
		try {
			return pdao.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
		}
		return null;
	}

	public long getTotal()  {
		try {
			return pdao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public List<Provider> paging(int page, int limit)  {
		try {
			return pdao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
		}
		return null;
	}

	public void setpdao(ProviderDao pdao) {
		this.pdao = pdao;
	}

	public ProviderDao getpdao() {
		return pdao;
	}
}
